package gfx;

// TODO: GraphicTileMap class
public class GraphicTileMap {
	
	private GraphicImage image;
	private int[] data;
	
	private int width;
	private int height;
	private int x;
	private int y;
	
	public GraphicTileMap(GraphicImage image, int width, int height) {
		
		this.setGraphicImage(image);
		this.width = width;
		this.height = height;
		
		this.data = new int[this.width * this.height];
	}
	
	
	
	/**
	 * @return Y position
	 */
	public int getY() {
		return y;
	}



	/**
	 * @param x X coordinate
	 * @param y Y coordinate
	 */
	public void setCoordinates(int x, int y) {
		this.x = x;
		this.y = y;
	}



	/**
	 * @return X position
	 */
	public int getX() {
		return x;
	}



	public int getTile(int x, int y) 
	{
		return this.data[y * width + x];
	}
	
	public void setTile(int x, int y, int tile) 
	{
		this.data[y * this.width + x] = tile;
	}
	
	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public GraphicImage getGraphicImage() {
		return image;
	}

	public void setGraphicImage(GraphicImage image) {
		this.image = image;
	}
}
